package regexTest;

/**
 * todo
 *
 * @author: luolidong
 * @create: 2021-07-10 15:41
 * @version: 1.0
 */
public class Test1 {
    public static void main(String[] args) {
        //.（点号）也是一个正则表达式，它匹配任何一个字符如："a" 或 "1"。
        String s="sdd2";
        //匹配0-9a-zA-Z开头，数字结尾
        boolean matches = s.matches("^[0-9a-zA-Z].*\\d$");
        boolean matches2 = s.matches("^[0-9a-zA-Z].+\\d$");
        String s1="12";
        /* \\代表转义为/d+   */
        boolean matches1 = s1.matches("\\d+");
        System.out.println("matches = " + matches);
        System.out.println("matches2 = " + matches2);
        System.out.println("matches1 = " + matches1);


    }
}
